
package org.jeecg.modules.flowable.enums;

import lombok.Getter;

/**
 * 流程实例状态
 * */
@Getter
public enum FlowInstanceStatusEnum {

    /**
     * 流程流转状态
     */
    TERMINATION(-10, "终止"),

    WAIT(-1, "等待重新提交"),

    ONGOING(1, "进行中"),

    FINISH(50, "完成");

    final Integer code;

    final String desc;

    FlowInstanceStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String formDesc(Integer code) {
        for (FlowInstanceStatusEnum statusEnum : FlowInstanceStatusEnum.values()) {
            if (statusEnum.code.equals(code)) {
                return statusEnum.desc;
            }
        }
        return null;
    }
}
